# -*- coding: utf-8 -*-
import pygame

pygame.init()
pygame.font.init()
fpsClock = pygame.time.Clock()
screen = pygame.display.set_mode((800,600))
pygame.display.set_caption("Ex17.11")
background = pygame.Color( 0, 0, 0)
font = pygame.font.SysFont("Tahoma", 36)
# msg = "Hello, World! สวัสดีชาวโลก"
#msg = msg.encode(encoding='utf-8')
text = font.render("Hello, World! สวัสดีชาวโลก", True, (255, 255, 255))
tx = 400-text.get_width()//2
ty = 300-text.get_height()//2
running = True
while running:
    fpsClock.tick(30)
    screen.fill(background)
    screen.blit(text, (tx, ty))
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
    pygame.display.flip()
pygame.font.quit()
pygame.quit()